#include<bits/stdc++.h>

using namespace std;
using ll = long long;
#define endl '\n'

#define REP(i, x, y) for (auto i = (x), _##i = (y); i < _##i; ++i)
#define PER(i, x, y) for (auto i = (x), _##i = (y); i > _##i; --i)

template<class T=int>
inline void OO(const T &coll, const char *del = ",") {
    copy(coll.begin(), coll.end(), ostream_iterator<decltype(*coll.begin())>(cerr, del));
    cerr << endl;
}

//bottom-up
int dp[1000000 + 500];
int a[] = {10, 5, 4, 2, 1};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) dp[i] = i;
    for (int i = 0; i < 5; i++)dp[a[i]] = 1;
    for (int i = 1; i <= n; i++) {
        //dp[n]=MIN(dp[n-1]+1,dp[n-2]+1,dp[n-4]+1....dp[n-a[i]]+1)
        int &best = dp[i];
        if (i >= a[0])best = min(best, dp[i - 10] + 1);
        if (i >= a[1])best = min(best, dp[i - 5] + 1);
        if (i >= a[2])best = min(best, dp[i - 4] + 1);
        if (i >= a[3])best = min(best, dp[i - 2] + 1);
        if (i >= a[4])best = min(best, dp[i - 1] + 1);
    }
    cout << dp[n] << endl;
    return 0;
}
